/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rh.game.loader;

import com.rh.game.Location;

import com.rh.game.impl.Location1;

import com.rh.util.Parser;

/**
 *
 * @author Hayden
 */
public class LocationBuffer extends AbstractXmlBuffer {
    private int x = 0;
    private int y = 0;
    private String id = "NULL";
    
    void characters(String pValue) {
        if ("ZoneID".equals(getStartElement()))  {
            id = pValue;
        }
        else if ("X".equals(getStartElement()))  {
            x = Parser.intValue(pValue);
        }
        else if ("Y".equals(getStartElement()))  {
            y = Parser.intValue(pValue);
        }
    }
    
    public Location getLocation()  {
        return Location1.valueOf(id, x, y);
    }
}
